package com.lovo.system.controller;

import com.lovo.system.utils.FileUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * 文件上传控制器
 */
@Controller
@RequestMapping("/file")
public class FileController {

    //上传文件到绝对路径
    @PostMapping("/uploadAbsolutePo")
    @ResponseBody
    public String uploadFileAbsolute(@RequestParam("purchaseImg") MultipartFile file) throws IOException {
        return FileUtils.uploadFileAbsolute(file);
    }

}
